﻿using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace ContactSMS.Infrastructure.Migrations
{
    /// <inheritdoc />
    public partial class addTcontactTableColumnPinyin : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AlterColumn<long>(
                name: "UserId",
                table: "T_Phone",
                type: "bigint",
                nullable: false,
                defaultValue: 0L,
                comment: "用户id",
                oldClrType: typeof(long),
                oldType: "bigint",
                oldNullable: true);

            migrationBuilder.AddColumn<string>(
                name: "Initial",
                table: "T_Contact",
                type: "longtext",
                nullable: false,
                comment: "首字母")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "PinYin",
                table: "T_Contact",
                type: "longtext",
                nullable: false,
                comment: "拼音")
                .Annotation("MySql:CharSet", "utf8mb4");
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "Initial",
                table: "T_Contact");

            migrationBuilder.DropColumn(
                name: "PinYin",
                table: "T_Contact");

            migrationBuilder.AlterColumn<long>(
                name: "UserId",
                table: "T_Phone",
                type: "bigint",
                nullable: true,
                oldClrType: typeof(long),
                oldType: "bigint",
                oldDefaultValue: 0L,
                oldComment: "用户id");
        }
    }
}
